package by.dkusch.aircompany.webapp.page.base.panels;

import org.apache.wicket.Component;
import org.apache.wicket.markup.html.WebMarkupContainer;
import org.apache.wicket.markup.html.link.Link;
import org.apache.wicket.markup.html.panel.Panel;

import by.dkusch.aircompany.webapp.page.main.HomePage;
import by.dkusch.aircompany.webapp.page.main.panel.LoginLogoutPanel;

public class HeaderPanel extends Panel {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	private Component loginLogoutPanel;

	public HeaderPanel(String id) {
		super(id);
	}

	@Override
	protected void onInitialize() {
		super.onInitialize();
		WebMarkupContainer logo = new WebMarkupContainer("headLeft");
		add(logo);
		logo.add(new Link<Void>("headLeft-link") {

			/**
			 * 
			 */
			private static final long serialVersionUID = 1L;

			@Override
			public void onClick() {
				setResponsePage(new HomePage());
			}
		});

		add(loginLogoutPanel = new LoginLogoutPanel("login-logout-panel"));

	}

	public Component getLoginLogoutPanel() {
		return loginLogoutPanel;
	}

	public void setLoginLogoutPanel(Component loginLogoutPanel) {
		this.loginLogoutPanel = loginLogoutPanel;
	}

}
